package com.czh.controller;

import com.czh.domain.ResponseResult;
import com.czh.domain.vo.RecordVo;
import com.czh.service.RecordService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
 * @author caozaihui
 */
@RestController
public class RecordController {
    @Resource
    private RecordService recordService;
    @GetMapping("/recordList")
    public ResponseResult<List<RecordVo>> getRecordList(){
        return recordService.getRecordList();
    }
    @PostMapping("/addRecord")
    public ResponseResult<Object> addRecord(@RequestBody Map<String,String>  record){
        return recordService.addRecord(record);
    }
    @DeleteMapping("/deleteRecord/{id}")
    public ResponseResult<Object> deleteRecord(@PathVariable("id") Integer id){
        return recordService.deleteRecord(id);
    }
}
